<?php

use yii\helpers\Url;
use yii\widgets\Pjax;
use yii\widgets\LinkPager;

$this->inline("title","合作伙伴");
?>
<div class="panel">
    <div class="panel-body">
        <div class="card-box">
            <div class="row">
                <div class="col-sm-6">
                    <div class="m-b-30">
                        <a href="<?=Url::toRoute('/partner/add')?>" class="btn btn-primary waves-effect waves-light">
                            添加合作伙伴
                            <i class="fa fa-plus"></i>
                        </a>
                    </div>
                </div>
            </div>
            <?php Pjax::begin(['id' => 'item-data-list']);?>
            <div class="">
                <div class="dataTables_wrapper form-inline dt-bootstrap no-footer">
                    <div class="row">
                        <form class="form-horizontal" action="" method="get">
                            <div class="col-md-offset-10 col-sm-2">
                                <div class="m-b-30 m-r-15">
                                    <div class="form-group">
                                        <div class="input-group">
                                            <input type="text" name="example-input1-group2" class="form-control" value="<?=Yii::$app->request->get('title')?>" placeholder="请输入轮播图描述">
                                            <span class="input-group-btn">
                                                <button type="button" class="btn waves-effect waves-light btn-primary"><i class="fa fa-search"></i></button>
                                            </span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </form>
                    </div>
                    <div class="row">
                        <div class="col-sm-12">
                            <table class="table table-striped dataTable no-footer">
                                <thead>
                                <tr role="row">
                                    <th class="col-sm-3 sorting">伙伴名称</th>
                                    <th class="col-sm-1 sorting">缩略图</th>
                                    <th class="col-sm-1 sorting">状态</th>
                                    <th class="col-sm-3 sorting">描述</th>
                                    <th class="col-sm-2 sorting">操作</th>
                                </tr>
                                </thead>
                                <tbody>
                                <?php foreach($data as $item):?>
                                    <tr class="gradeA odd">
                                        <td><?=mb_substr($item['title'],0,10,'utf-8').'...'?></td>
                                        <td><img style="width: 20px;" src="<?=$this->imghost.$item['picture']?>"></td>
                                        <td><?=$item['status']?></td>
                                        <td><?=$item['desc']?></td>
                                        <td class="actions">
                                            <a onclick="location.href=this.href" href="<?=Url::toRoute('/partner/add?id='.$item['id'])?>" class="on-default edit-row">
                                                <i class="fa fa-pencil"></i>
                                            </a>
                                            <a data-id="<?= $item['id']?>" onclick="app.deleteData(this);return false;" href="<?=Url::toRoute('/partner/delete')?>" class="on-default remove-row">
                                                <i class="fa fa-trash-o"></i>
                                            </a>
                                        </td>
                                    </tr>
                                <?php endforeach;?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            <?php Pjax::end();?>
        </div>
    </div>
</div>
